package O_Chain;
import java.io.*;

public class OutputChain {
    public static void main(String[] args)
    {
        String fileName = "d:\\data1.dat";
        try
        {
            DataOutputStream dataOut = new DataOutputStream(
                    new BufferedOutputStream(new FileOutputStream(fileName)));
            dataOut.writeInt(255);
            dataOut.writeInt(-1);
            dataOut.writeInt(0);
            System.out.println(dataOut.size()+"bytes have been written.");
            dataOut.close();
        }
        catch(IOException e)
        {
            System.out.println(e.getMessage());
        }
    }
}
